package s2elinshu;

import java.util.Scanner;

public class J10Retangle {
	public static void main(String[] args){
		String str;
		int width,height;
		double area, perim;
	
		width = inputWidth(makeScanner());
		height= inputHeight(makeScanner());
		str = inputColor(makeScanner());
		area = getarea(width,height);
		perim = getperim(width,height);
		
		System.out.println("입력한 가로값은"+width+"세로값은"+height);
		System.out.println("색상은"+str);
		System.out.println("면적은"+area);
		System.out.println("둘레는"+perim);
				
	}// main 닫음
    
	private static String inputColor(Scanner sc) {
		String str;
		System.out.println("색상을 입력하세요");
		str = sc.next();
		return str;
	}
	private static int inputHeight(Scanner sc) {
        int height;
        System.out.println("세로값을 입력하세요");
        height = sc.nextInt();
		return height;
	}
	private static int inputWidth(Scanner sc) {
		int width;
		System.out.println("가로값을 입력하세요");
		width = sc.nextInt();
		return width;
	}
	//scanner 생성
	public static Scanner makeScanner(){
	Scanner sc = new Scanner(System.in);
	return sc;
	}
	//scanner 소멸
	public static void closeScanner(Scanner sc){
		sc.close();
	}
	private static double getperim(int width, int height) {
		return (2 * (width + height));
	}
	private static double getarea(int width, int height) {
		return (width * height);
	}

}// class 닫음
